<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML LANG="EN">
<HEAD>
<TITLE>VT100.net: Digital VT220 Programmer Reference Manual</TITLE>
<LINK HREF="vt220-rm.css" TYPE="text/css" REL="STYLESHEET">
</HEAD>
<BODY>
<DIV CLASS="navbar"><A HREF="http://vt100.net/"><IMG CLASS="button" SRC="vt100.net-logo.png" ALT="VT100.net" HEIGHT="16" WIDTH="102"></A> VT220 Programmer Reference Manual<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="chapter3.html">Chapter 3</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="appendixa.html">Appendix A</A></TD>
</TR>
</TBODY>
</TABLE>
<HR></DIV>
<H1 ID="S4">4 Received Codes</H1>
<H2 ID="S4.1">4.1 General</H2>
<P>This chapter describes the terminal's response to codes it may
receive from an application or host system. This Chapter assumes
you are familiar with the character encoding conventions and
terminology covered in <A HREF="chapter2.html">Chapter 2</A>.</P>
<P>All data received by the VT220 consists of single and
multiple-character codes: graphic (printing or display)
characters, control characters, escape sequences, control
sequences and device control strings. Much of that data consists
of graphic characters that simply appear on the screen with no
other effect. Control characters, escape sequences, control
sequences and device control strings are all "control functions"
that you use in your program to specify how the terminal should
process, transmit, and display characters. Each control function
has a unique name and each name has a unique abbreviation
(mnemonic). Both the name and the abbreviation are standardized.</P>
<P>By default, the terminal interprets individual control and graphic
characters according to the DEC Multinational Character Set code
mapping (<A HREF="chapter2.html">Chapter 2</A>).</P>
<P CLASS="note">NOTE: The terminal usually ignores control codes it does not
support. However, codes sent to the terminal other than those
specified in this manual can cause unexpected results.</P>
<P>The codes described in this chapter are described as used in VT220
mode unless otherwise indicated.</P>
<H2 ID="S4.2">4.2 Control Characters</H2>
<P><A HREF="table4-1.html">Tables 4-1</A> and <A HREF="table4-2.html">4-2</A> define the action taken by the terminal when
receiving C0 and C1 control characters. The VT220 does not
recognize all C0 or C1 characters. Those not shown in either table
are ignored (no action taken).</P>
<P><A HREF="table4-1.html">Table 4-1</A> shows that SO (0/14) and SI (0/15) are also called LS1
and LS0, respectively. SO and SI (shift out and shift in) are the
traditional ASCII names or mnemonics. LS1 and LS0 (lock shift G1
and lock shift G0) are alternate names that are useful when
dealing with the variety of character set mappings possible. LS1
and LS0 are the names used in this chapter.</P>
<P><A HREF="table4-2.html">Table 4-2</A> shows the equivalent 7-bit code extension for each 8-bit
C1 code. The code extensions require one more byte than the C1
codes. <A HREF="chapter2.html">Chapter 2</A> describes when to use C1 codes and when to use
7-bit code extensions.</P>
<H2 ID="S4.3">4.3 Compatibility Level (DECSCL)</H2>
<P>You can set the terminal to a particular level of operation for
compatibility with an application. There are two possible levels,
level 1 (VT100 operation) and level 2 (VT200 operation). You can
set the VT220 (a level 2 terminal) to either level 1 or level 2.
These
functional levels are defined in <A HREF="table4-3.html">Table 4-3</A>.</P>
<P>You can set the compatibility level of the terminal by using the
following sequences.</P>
<P CLASS="note">NOTE: You only have to apply restrictions for
a lower compatibility level when there
is a noncompatible interaction with
software written for the lower level.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/6 3/1 2/2  7/0
CSI   6   1   "    p</PRE></TD>
<TD>Set terminal for level 1 compatibility (VT100 mode).</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/6 3/2 2/2  7/0
CSI   6   2   "    p</PRE></TD>
<TD>Set terminal for level 2 compatibility (VT200 mode, 8-bit controls).</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/6 3/2 3/11 3/0 2/2 7/0
CSI   6   2   ;    0   "   p</PRE>
or
<PRE>9/11 3/6 3/2 3/11 3/2 2/2 7/0  
CSI   6   2   ;    2   "   p</PRE></TD>
<TD>Set terminal for level 2 compatibility (VT200 mode, 8-bit controls).</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/6 3/2 3/11 3/1 2/2 7/0
CSI   6   2   ;    1   "   p</PRE></TD>
<TD>Set terminal for level 2 compatibility (VT200 mode, 7-bit controls).</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.4">4.4 Character Set Selection (SCS)</H2>
<P>Character encoding in the VT220 was introduced in <A HREF="chapter2.html">Chapter 2</A>. The
control functions you need to select different graphic character
sets are described in this section. Coding differences between the
VT220 and VT100 terminals are pointed out where they may affect
software compatibility between the VT220 and VT100-type terminals.</P>
<P>The VT220's graphic character repertoire consists of the following
graphic sets. (See <A HREF="chapter2.html">Chapter 2</A> for a description of these character
sets).</P>
<UL>
<LI>ASCII graphics</LI>
<LI>DEC supplemental graphics (level 2)</LI>
<LI>DEC special graphics</LI>
<LI>National replacement character (NRC) sets</LI>
<LI>Down-line-loadable (level 2)</LI>
</UL>
<P>Generally, you select character sets as follows (<A HREF="figure4-1.html">Figure 4-1</A>).</P>
<P CLASS="note">NOTE: GR is available only in VT200 mode.</P>
<P>First, you use SCS sequences to designate graphic sets as G0, G1,
G2, and G3. This makes the graphics sets available for your program
when you map them into GL or GR. To map one of these sets into GL
or GR, you must invoke the selected set (G0 through G3) into GL or
GR by using locking shifts (LS0, LS1, LS2, LS3, LS1R, LS2R, LS3R) or
single shifts (SS2, SS3).</P>
<P>Character sets remain designated until the terminal receives
another SCS sequence. All locking shifts remain active until the
terminal receives another locking shift. Single shifts SS2 and SS3
are active for only the next single graphic character.</P>
<P>You do not need to select character sets in this manner every time
you use the terminal, because there is a default mapping. The
default mapping in VT200 mode is ASCII graphics in GL and DEC
supplemental graphics in GR (DEC multinational). The default
graphic character set mapping is reset whenever you power up the
terminal. Your application can also select the default mapping by
using the soft terminal reset sequence (DECSTR).</P>
<P>The following sections describe all control functions for
designating and invoking graphic character sets.</P>
<H3 ID="S4.4.1">4.4.1 Designating Hard Character Sets</H3>
<P>You designate hard character sets (ASCII, DEC supplemental
graphics, DEC special graphics, and national replacement character
sets) as G0 through G3, using the following escape sequence
formats.</P>
<TABLE>
<THEAD>
<TR>
<TH>Escape Sequence</TH>
<TH>Designated As</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/8
ESC   (   {final}</PRE></TD>
<TD>G0</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/9
ESC   )   {final}</PRE></TD>
<TD>G1</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/10
ESC   *   {final}</PRE></TD>
<TD>G2</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/11
ESC   +   {final}</PRE></TD>
<TD>G3</TD>
</TR>
</TBODY>
</TABLE>
<P CLASS="note">NOTE: You cannot designate a G2 and G3 set in VT100 mode.</P>
<P>The final character in the escape sequences above represents the
character set you want to designate. <A HREF="table4-4.html">Table 4-4</A> lists the available
character sets and their associated final character.</P>
<P>To designate a character set as any of the graphic sets (G0
through G3), you must include a final character in one of the
escape sequences in <A HREF="table4-4.html">Table 4-4</A>. For example, to designate the ASCII
character set as the G0 graphic set you would use the following
escape sequence.</P>
<PRE>   ESC  (  B</PRE>
<P>To designate the ASCII character set as the G2 graphic set you
would use this escape sequence.</P>
<PRE>   ESC  *  B</PRE>
<P>Note that there is a definite pattern of escape sequences in the
designation process.</P>
<H3 ID="S4.4.2">4.4.2 Designating Soft (Down-Line-Loadable) Character Sets</H3>
<P>You can define a soft character set (font) that may or may not
replace one of the existing hard sets (ROM fonts). If you do
replace a hard set, the replacement occurs for both the 80 and
132-column versions.</P>
<P>A soft character set that replaces a hard character set remains in
effect until the soft character set is cleared or redefined. The
soft character set is cleared by the "Recall" and "Default" set-up
features, and by the power-up self-test. The soft character set is
redefined by a DECDLD device control string, described later in
this chapter. If the soft character set you define does not
replace an existing hard set, then it is used in addition to the
hard sets.</P>
<P CLASS="note">NOTE: Only VT220 mode supports the designation of a soft character set.</P>
<P>You designate a soft (down-line-loadable) character set by using
the following escape sequences.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Escape Sequence</TH>
<TH ALIGN="LEFT">Designate As</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/8 ....... 
ESC   (    Dscs</PRE></TD>
<TD>G0</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/9 ....... 
ESC   )    Dscs</PRE></TD>
<TD>G1</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/10 ...... 
ESC   *    Dscs</PRE></TD>
<TD>G2</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>1/11 2/11 ...... 
ESC   +    Dscs</PRE></TD>
<TD>G3</TD>
</TR>
</TBODY>
</TABLE>
<P>In these sequences, Dscs is a variable that defines the soft
character set used.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Dscs</TH>
<TH ALIGN="LEFT">Function</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD><PRE>I I F        </PRE></TD>
<TD>Generic Dscs.<BR>
A Dscs can consist of 0 to 2 intermediates (I) and a final (F).<BR>
Intermediates are in the range 2/0 to 2/15.<BR>
Finals are in the range 3/0 to 7/14.</TD>
</TR>
</TBODY>
</TABLE>
<P>Here are three examples of Dscs.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Dscs</TH>
<TH ALIGN="LEFT">Function</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD><PRE>2/0 4/0
sp   @</PRE></TD>
<TD>Defines a character set as unregistered soft set. This value
is the recommended default value for user-defined sets.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>4/2
 B</PRE></TD>
<TD>Defines the soft character set to be ASCII.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>2/6 2/5  4/3 
 &amp;   %    c</PRE></TD>
<TD>Defines the character set as "<CODE>&amp;%c</CODE>", which is
currently an unregistered set.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.4.3">4.4.3 Invoking Character Sets with Locking Shifts</H3>
<P>Once you have designated your character sets, you can invoke G0, G1,
G2, or G3 into GL or GR. To invoke a set, you use the locking
shift (LS) control functions, as shown in <A HREF="table4-5.html">Table 4-5</A> and Figures <A HREF="figure4-2.html">4-2</A> and <A HREF="figure4-3.html">4-3</A>.</P>
<H3 ID="S4.4.4">4.4.4 Invoking Character Sets with Single Shifts</H3>
<P>After you designate your character sets, you can invoke G2 or G3
into GL for a single graphic character. To do this, you use the
single shift (SS) control functions described below and in Figures <A HREF="figure4-2.html">4-2</A>
and <A HREF="figure4-3.html">4-3</A>.</P>
<P>All single shifts are active for only the next single graphic
character. The terminal returns the previous character set
after displaying a single graphic character.</P>
<H4 ID="S4.4.4.1">4.4.4.1 SS2 -- Single Shift G2</H4>
<P>SS2 is an 8-bit control character (8/14) that invokes G2 into GL for the next graphic
character. You can also express SS2 as an escape sequence when
coding for a 7-bit environment, as follows.</P>
<PRE>    1/11  4/14
    ESC    N</PRE>
<H4 ID="S4.4.4.2">4.4.4.2 SS3 -- Single Shift G3</H4>
<P>SS3 is an 8-bit control character (8/15) that invokes G3 into GL for the next graphic
character. You can also express SS3 as an escape sequence when
coding for a 7-bit environment as follows.</P>
<PRE>    1/11  4/15
    ESC    O</PRE>
<H2 ID="S4.5">4.5 Select C1 Controls</H2>
<P>You can use <EM>select C1 controls</EM> (code extension announcers) in your
program to control the representation of C1 control codes returned
to the application by the terminal. (See <A HREF="chapter2.html">Chapter 2</A> for information
on working with 7-bit and 8-bit environments.) The terminal always
accepts 7-bit or 8-bit forms for C1 controls in either VT200 mode.</P>
<P>Digital recommends that you use DECSCL sequences instead of select
C1 controls. The advantage is that DECSCL performs a soft reset,
putting the terminal in a known state, in addition to setting the
terminal mode and C1 control state.</P>
<P CLASS="note">NOTE: These sequences are supported only in VT200 mode.</P>
<H3 ID="S4.5.1">4.5.1 Select 7-Bit C1 Control Transmission (S7C1T)</H3>
<P>The following sequence converts all C1 codes returned to the
application to their equivalent 7-bit code extensions.</P>
<PRE>    1/11 2/0  4/7
    ESC  sp    F</PRE>
<P CLASS="note">NOTE: The S7C1T sequence is ignored in VT100 or VT52 mode.</P>
<H3 ID="S4.5.2">4.5.2 Select 8-Bit C1 Control Transmission (S8C1T)</H3>
<P>The following sequence returns C1 codes to the application without
converting them to their equivalent 7-bit code extensions.</P>
<PRE>    1/11 2/0  4/6
    ESC  sp    G</PRE>
<H2 ID="S4.6">4.6 Terminal Modes</H2>
<P>A <EM>mode</EM> is one of several operating states used by the terminal.
Each mode changes the way the terminal works. <A HREF="table4-6.html">Table 4-6</A> lists the
selectable modes and their set/reset control sequences. The
following sections describe these modes.</P>
<P>Each mode has an identifying name (mnemonic). You can set or reset
modes individually or in strings using set mode (SM) or reset
mode (RM) control sequences. You can also lock certain features, called
user preference features, by using the General Set-Up
screen; this prevents the host from changing the feature.</P>
<P>Digital private control sequences (permitted within the extensions
of ANSI standards) are identified by DEC in the control sequence
mnemonic. These sequences include a question mark character (?)
after the control sequence introducer.</P>
<P>You can also select these modes from the keyboard by using set-up
screens.</P>
<H3 ID="S4.6.1">4.6.1 Set Mode (SM)</H3>
<P>The set mode sequence for ANSI modes is as follows.</P>
<PRE>    9/11      3/11   3/11    6/8
    CSI   Ps   ; .... ;   Ps  h</PRE>
<P>The set mode sequence for Digital private modes is as follows.</P>
<PRE>    9/11  3/15      3/11   3/11    6/8
    CSI    ?    Ps   ; .... ;   Ps  h</PRE>
<P>You use these sequences to set the ANSI and Digital private modes,
individually or in strings. Tables <A HREF="table4-7.html">4-7</A> and <A HREF="table4-8.html">4-8</A> list the Ps
parameters. You cannot use ANSI modes and Digital private modes in
the same SM string.</P>
<H3 ID="S4.6.2">4.6.2 Reset Mode (RM)</H3>
<P>The reset mode sequence for ANSI modes is as follows.</P>
<PRE>    9/11      3/11   3/11    6/12
    CSI   Ps   ; .... ;   Ps  l</PRE>
<P>The reset mode sequence for Digital private modes is as follows.</P>
<PRE>    9/11  3/15      3/11   3/11    6/12
    CSI    ?    Ps   ; .... ;   Ps  l</PRE>
<P>You use these sequences to reset the ANSI and Digital private
modes, individually or in strings. Tables <A HREF="table4-7.html">4-7</A> and <A HREF="table4-8.html">4-8</A> list the Ps
parameters. You cannot use ANSI modes and Digital private modes in
the same RM string.</P>
<H3 ID="S4.6.3">4.6.3 Keyboard Action Mode (KAM)</H3>
<P>Keyboard Action mode lets your program lock and unlock the
keyboard. When the keyboard is locked, it cannot send codes to the
program. To alert the operator, the terminal turns on the Wait
indicators and disables the keyclick features whenever the keyboard
is locked.</P>
<P></P>
<P>You can set or reset keyboard action mode as follows.</P>
<P CLASS="note">NOTE: This is a user preference feature that you can lock by using set-up.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/2  6/8
CSI   2    h</PRE></TD>
<TD>Locks the keyboard for all following keystrokes.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/2  6/12 
CSI   2    l</PRE></TD>
<TD>Unlocks the keyboard, unless it is locked by DC3.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.4">4.6.4 Insert/Replace Mode (IRM)</H3>
<P>The terminal displays received characters at the cursor position.
Insert/Replace mode determines how the terminal adds characters to
the screen. Insert mode displays the new character and moves
previously displayed characters to the right. Replace mode adds
characters by replacing the character at the cursor position.</P>
<P>You can set or reset insert/replace mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/4  6/8
CSI   4    h</PRE></TD>
<TD>Selects insert mode. New display characters move old display characters to the right. Characters moved past the right margin are lost.</TD>
</TR>
<TR VALIGN="TOP">
<TD></TD>
<TD><PRE>9/11 3/4  6/12 
CSI   4    l</PRE></TD>
<TD>Selects replacement mode. New display characters replace old display characters at the cursor position. The old character is erased.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.5">4.6.5 Send/Receive Mode (SRM)</H3>
<P>Send/receive mode turns local echo on or off. When send/receive
mode is reset (local echo on), every character sent from the
keyboard automatically appears on the screen. Therefore, the host
does not have to send (echo) the character back to the terminal
display. When send/receive mode is set (local echo off), the
terminal only sends characters to the application. The host must
echo the characters back to the screen.</P>
<P>You can set or reset send/receive mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/1  3/2 6/8
CSI   1    2   h</PRE></TD>
<TD>Turns off (disables) local echo. When the terminal sends characters to the host, the host must echo characters back to the screen.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/1  3/2 6/12 
CSI   1    2   l</PRE></TD>
<TD>Turns on (enables) local echo. When the terminal sends characters, the characters are automatically sent to the screen.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.6">4.6.6 Line Feed/New Line Mode (LNM)</H3>
<P>Line feed/new line mode selects the control character(s)
transmitted to the application by the <SPAN CLASS="keyname">Return</SPAN> and <SPAN CLASS="keyname">Enter</SPAN> keys. <SPAN CLASS="keyname">Enter</SPAN>
sends the same code as <SPAN CLASS="keyname">Return</SPAN> only when the auxiliary keypad is in
Keypad numeric mode (DECKPNM).</P>
<P>Line feed/new line also selects the action taken by the terminal
when receiving line feed (LF), form feed (FF), or vertical tab (VT)
codes. These three codes are always processed identically.</P>
<P>You set and reset line feed/new line mode as follows.</P>
<P CLASS="note">NOTE: For compatibility with Digital software, this mode should always be reset.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/2  3/0 6/8
CSI   2    0   h</PRE></TD>
<TD>Causes a received LF, FF, or VT code to move the cursor to the first column of the next line. <SPAN CLASS="keyname">Return</SPAN> sends both a CR and a LF code.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/2  3/0 6/12 
CSI   2    0   l</PRE></TD>
<TD>Causes a received LF, FF, or VT code to move the cursor to the next line in the current column. <SPAN CLASS="keyname">Return</SPAN> sends a CR code only.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.7">4.6.7 Text Cursor Enable Mode (DECTCEM)</H3>
<P>Text cursor enable mode determines if the text cursor is visible.</P>
<P>You set and reset this mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/2 3/5 6/8
CSI   ?    2   5   h</PRE></TD>
<TD>Makes the cursor visible.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/2 3/5 6/12 
CSI   ?    2   5   l</PRE></TD>
<TD>Makes the cursor not visible.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.8">4.6.8 Cursor Key Mode (DECCKM)</H3>
<P>Cursor key mode determines the characters sent by the cursor keys.</P>
<P>You can set and reset this mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/1 6/8
CSI   ?    1   h</PRE></TD>
<TD>Causes the cursor keys to send application control functions.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/1 6/12 
CSI   ?    1   l</PRE></TD>
<TD>Causes the cursor keys to generate ANSI cursor control sequences.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.9">4.6.9 ANSI/VT52 Mode (DECANM)</H3>
<P>In ANSI mode, reset selects VT52 compatibility mode. In VT52 mode,
the terminal responds like a VT52 terminal to private Digital
sequences. The reset state of this mode sets the terminal to the
VT52 mode. There is no set state for this mode.</P>
<PRE>9/11  3/15  3/2  6/12
CSI    ?     2    l</PRE>
<P>Sets the terminal to VT52 mode.</P>
<H3 ID="S4.6.10">4.6.10 Column Mode (DECCOLM)</H3>
<P>Column mode selects the number of columns per line (80 or 132) on
the screen. The screen can display 24 lines of text with either
selection.</P>
<P>You select the number of columns per line as follows.</P>
<P CLASS="note">NOTE: When the terminal receives the sequence, the screen is
erased and the cursor moves to the home position. This also sets
the scrolling region for full screen (24 lines).</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/3 6/8
CSI   ?    3   h</PRE></TD>
<TD>Selects 132 columns per line.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/3 6/12 
CSI   ?    3   l</PRE></TD>
<TD>Selects 80 columns per line.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.11">4.6.11 Scrolling Mode (DECSCLM)</H3>
<P>Scrolling is the upward or downward movement of existing lines on
the screen. There are two methods of scrolling, jump scroll and
smooth scroll (6 lines per second).</P>
<P>You can set or reset the scroll mode as follows.</P>
<P CLASS="note">NOTE: This is a user preference feature that you can lock by using set-up.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/4 6/8
CSI   ?    4   h</PRE></TD>
<TD>Selects smooth scroll. Smooth scroll lets the terminal add no more than 6 lines per second to the screen.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/4 6/12 
CSI   ?    4   l</PRE></TD>
<TD>Selects jump scroll. Jump scroll lets the terminal add lines to the screen as fast as possible.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.12">4.6.12 Screen Mode (DECSCNM)</H3>
<P>Screen mode selects either a dark or light (reverse) display
background on the screen.</P>
<P>You can set or reset screen mode as follows.</P>
<P CLASS="note">NOTE: This is a user preference feature that you can lock by using set-up.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/5 6/8
CSI   ?    5   h</PRE></TD>
<TD>Selects reverse video (dark characters on a light background).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/5 6/12 
CSI   ?    5   l</PRE></TD>
<TD>Selects normal screen (light characters on a dark background).</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.13">4.6.13 Origin Mode (DECOM)</H3>
<P>Origin mode allows cursor addressing relative to a user-defined
origin. This mode resets when the terminal is powered up or reset.
It does not affect the erase in display (ED) function.</P>
<P>You can set or reset origin mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/6 6/8
CSI   ?    6   h</PRE></TD>
<TD>Selects the home position with line numbers starting at top margin of the user-defined scrolling region. The cursor cannot move out of the scrolling region.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/6 6/12 
CSI   ?    6   l</PRE></TD>
<TD>Selects the home position in the upper-left corner of screen. Line numbers are independent of the scrolling region. Use the CUP sequence to move the cursor out of the scrolling region.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.14">4.6.14 Auto Wrap Mode (DECAWM)</H3>
<P>This mode selects where received graphic characters appear when
the cursor is at the right margin.</P>
<P>You can set or reset auto wrap mode as follows.</P>
<P CLASS="note">NOTE: Regardless of this selection, the tab character never moves
the cursor to the next line.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/7 6/8
CSI   ?    7   h</PRE></TD>
<TD>Selects auto wrap. Graphic display characters received when the cursor is at the right margin appear on the next line. The display scrolls up if the cursor is at the end of the scrolling region.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/7 6/12 
CSI   ?    7   l</PRE></TD>
<TD>Turns off auto wrap. Graphic display characters received when the cursor is at the right margin replace previously displayed characters.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.15">4.6.15 Auto Repeat (DECARM)</H3>
<P>Auto repeat mode selects automatic key repeating. When auto repeat
mode is set, a key pressed for more than 0.5 seconds automatically
repeats the transmission of the character until the key is
released. The following keys never auto repeat: <SPAN CLASS="keyname">Hold Screen</SPAN>, <SPAN CLASS="keyname">Print
Screen</SPAN>, <SPAN CLASS="keyname">Set-Up</SPAN>, <SPAN CLASS="keyname">Data/Talk</SPAN>, <SPAN CLASS="keyname">Break</SPAN>, <SPAN CLASS="keyname">Return</SPAN>, <SPAN CLASS="keyname">Compose Character</SPAN>, <SPAN CLASS="keyname">Lock</SPAN>,
<SPAN CLASS="keyname">Shift</SPAN>, and <SPAN CLASS="keyname">Ctrl</SPAN>.</P>
<P>You can set or reset auto repeat mode as follows.</P>
<P CLASS="note">NOTE: This is a user preference feature that you can lock by using set-up.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/8 6/8
CSI   ?    8   h</PRE></TD>
<TD>Selects auto repeat mode. A key pressed for more than 0.5 seconds automatically repeats.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/8 6/12 
CSI   ?    8   l</PRE></TD>
<TD>Turns off auto repeat. Keys pressed do not automatically repeat.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.16">4.6.16 Print Form Feed Mode (DECPFF)</H3>
<P>This mode determines whether or not the terminal sends a print
termination character after a screen print. The form feed control
character (FF) serves as the print termination character.</P>
<P>You can set or reset print form feed mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/1 3/8  6/8
CSI   ?    1   8    h</PRE></TD>
<TD>Selects form feed (FF) as print termination character. The terminal sends this character to the printer after each print screen operation.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/1 3/8  6/12 
CSI   ?    1   8    l</PRE></TD>
<TD>Selects no termination character. The terminal does not send a form feed (FF) to the printer after each print screen operation.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.17">4.6.17 Print Extent Mode (DECPEX)</H3>
<P>Print extent mode selects the full screen or the scrolling region
to print during a print screen operation.</P>
<P>You can set or reset this mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/1 3/9  6/8
CSI   ?    1   9    h</PRE></TD>
<TD>Selects full screen to print during a print screen operation.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/1 3/9  6/12 
CSI   ?    1   9    l</PRE></TD>
<TD>Selects scrolling region to print during a print screen operation.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.18">4.6.18 Keypad Mode (DECKPAM/DECKPNM)</H3>
<P>The auxiliary keypad generates either numeric characters or
control functions. Selecting application or numeric keypad mode
determines the type of characters.</P>
<P>You can select the keypad mode as follows.</P>
<P CLASS="note">NOTE: When the terminal is powered up or reset, the terminal
selects numeric keypad mode.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Application<BR>(DECKPAM)</TD>
<TD><PRE>1/11 3/13 
ESC   =</PRE></TD>
<TD>Selects application keypad mode. Keypad keys send application control functions.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Numeric<BR>(DECKPNM)</TD>
<TD><PRE>1/11 3/14 
ESC   &gt;</PRE></TD>
<TD>Selects numeric keypad mode. Keypad keys send characters that match the numeric, comma, period, and minus sign keys on main keypad. <SPAN CLASS="keyname">PF1</SPAN> through <SPAN CLASS="keyname">PF4</SPAN> send control functions.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.6.19">4.6.19 Character Set Mode (DECNRCM)</H3>
<P>Character set mode determines whether the terminal uses national
replacement character sets or the DEC multinational character set.</P>
<P>You can select this mode as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Mode</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set</TD>
<TD><PRE>9/11 3/15 3/4 3/2 6/8
CSI   ?    4   2   h</PRE></TD>
<TD>Selects national mode. The terminal now generates 7-bit characters from the NRC sets.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reset</TD>
<TD><PRE>9/11 3/15 3/4 3/2 6/12
CSI   ?    4   2   l</PRE></TD>
<TD>Selects multinational mode. The terminal can now generate 8-bit characters from the multinational character set, including 7-bit characters from the ASCII set.</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.7">4.7 Cursor Positioning</H2>
<P>The cursor indicates the active screen position where the next
character will appear (in the absence of auto wrap). A number of
operations implicitly affect cursor positioning. In addition, you
can control cursor movement using the following sequences.</P>
<P CLASS="note">NOTE: Pn is a variable, ASCII coded, numeric parameter. If you
select no parameter or a parameter value of 0, the terminal
assumes the parameter equals 1.</P>
<TABLE>
<COL WIDTH="20%">
<COL SPAN="2" WIDTH="40%">
<THEAD>
<TR>
<TH ALIGN="LEFT">Name</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Cursor Up<BR>(CUU)</TD>
<TD><PRE>9/11     4/1
CSI  Pn   A</PRE></TD>
<TD>Moves the cursor up Pn lines in the same column. The cursor stops at the top margin.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor Down<BR>(CUD)</TD>
<TD><PRE>9/11     4/2
CSI  Pn   B</PRE></TD>
<TD>Moves the cursor down Pn lines in the same column. The cursor stops at the bottom margin.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor Forward<BR>(CUF)</TD>
<TD><PRE>9/11     4/3
CSI  Pn   C</PRE></TD>
<TD>Moves the cursor right Pn columns. The cursor stops at the right margin.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor Backward<BR>(CUB)</TD>
<TD><PRE>9/11     4/4
CSI  Pn   D</PRE></TD>
<TD>Moves the cursor left Pn columns. The cursor stops at the left margin.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor Position<BR>(CUP)</TD>
<TD><PRE>9/11     3/11    4/8 
CSI  Pl   ;   Pc  H</PRE></TD>
<TD>Moves the cursor to line Pl, column Pc. The numbering of the lines and columns depends on the state (set/reset) of origin mode (DECOM).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Horizontal And Vertical Position<BR>(HVP)</TD>
<TD><PRE>9/11     3/11    6/6 
CSI  Pl   ;   Pc  f</PRE></TD>
<TD>Moves the cursor to line Pl, column Pc. The numbering of the lines and columns depends on the state (set/reset) of origin mode (DECOM). Digital recommends using CUP instead of HVP.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Index (IND)</TD>
<TD><PRE>1/11 4/4
ESC   D</PRE></TD>
<TD>IND is an 8-bit control character (8/4). It can be expressed as an escape sequence for a 7-bit environment. IND moves the cursor down one line in the same column. If the cursor is at the bottom margin, the screen performs a scroll-up.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Reverse Index (RI)</TD>
<TD><PRE>1/11 4/13
ESM   M</PRE></TD>
<TD>RI is an 8-bit control character (8/13). It can be expressed as an escape sequence for a 7-bit environment. RI moves the cursor up one line in the same column. If the cursor is at the top margin, the screen performs a scroll-down.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Next Line (NEL)</TD>
<TD><PRE>1/11 4/5
ESC   E</PRE></TD>
<TD>NEL is an 8-bit control character (8/5). It can be expressed as an escape sequence for a 7-bit environment. NEL moves the cursor to the first position on the next line. If the cursor is at the bottom margin, the screen performs a scroll-up.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Save Cursor (DECSC)</TD>
<TD><PRE>1/11 3/7
ESC   7</PRE></TD>
<TD><P>Saves the following in terminal memory.</P><UL>
<LI>cursor position</LI>
<LI>graphic rendition</LI>
<LI>character set shift state</LI>
<LI>state of wrap flag</LI>
<LI>state of origin mode</LI>
<LI>state of selective erase</LI>
</UL></TD>
</TR>
<TR VALIGN="TOP">
<TD>Restore Cursor (DECRC)</TD>
<TD><PRE>1/11 3/8
ESC   8</PRE></TD>
<TD>Restores the states described for (DECSC) above. If none of these characteristics were saved, the cursor moves to home position;
origin mode is reset; no character attributes are assigned; and the default character set mapping is established.</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.8">4.8 Tab Stops</H2>
<P>You select tab stop positions on the horizontal lines of the
screen. The cursor advances (tabs) to the next tab stop when the
terminal receives a horizontal tab code (HT, 0/9). If there is no
next tab, HT moves the cursor to the right margin.</P>
<P>You can set and clear the tab stops as follows.</P>
<P CLASS="note">NOTE: This is a user preference feature that you can lock in set-up.</P>
<TABLE>
<COL WIDTH="20%">
<COL SPAN="2" WIDTH="40%">
<THEAD>
<TR>
<TH ALIGN="LEFT">Name</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Horizontal Tab Set (HTS)</TD>
<TD><PRE>1/11 4/8
ESC   H</PRE></TD>
<TD>HTS sets a tab stop at the current column. HTS is an 8-bit control character (8/8) that you can also express as an escape sequence when coding for a 7-bit environment.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="3">Tabulation Clear (TBC)</TD>
<TD><PRE>9/11 6/7
CSI   g</PRE></TD>
<TD>Clears a horizontal tab stop at cursor position.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/0 6/7 
CSI   0   g</PRE></TD>
<TD>Clears a horizontal tab stop at cursor position.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/3 6/7 
CSI   3   g</PRE></TD>
<TD>Clears all horizontal tab stops.</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.9">4.9 Character Rendition and Attributes</H2>
<P>Character rendition and attributes are display features that
affect the way a character is displayed, without changing the
character. You can change character rendition using select graphic
rendition (SGR) sequences. You can also designate characters to be
erasable or not erasable when by using the select character attribute
(DECSCA) sequence. DECSCA affects erase sequences.</P>
<H3 ID="S4.9.1">4.9.1 Select Graphic Rendition (SGR)</H3>
<P>You can select one or more character renditions at a time by using
the following format.</P>
<PRE>   9/11    3/11         6/13
   CSI  Ps  ;   Ps ...   m</PRE>
<P>When you use multiple parameters, they are executed in sequence.
The effects are cumulative. For example, you can change from
increased intensity to blinking-underlined as follows.</P>
<PRE>   9/11 3/0 3/11 3/4 3/11 3/5 6/13
   CSI   0   ;    4   ;    5   m</PRE>
<P>When you select a single parameter, no delimiter (3/11) is used.
For example, you can select the blinking only parameter as
follows.</P>
<PRE>   9/11 3/5 6/13
   CSI   5   m</PRE>
<P>After you select an attribute, all new characters received by the
terminal appear with that attribute. If you move the characters by
scrolling, the attribute moves with the characters.</P>
<P>You can select character attributes by using the formats described
above and the following Ps parameter values.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Ps</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD><PRE>3/0
 0</PRE></TD>
<TD>All attributes off.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/1
 1</PRE></TD>
<TD>Display bold.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/4
 4</PRE></TD>
<TD>Display underscored.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/5
 5</PRE></TD>
<TD>Display blinking.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/7
 7</PRE></TD>
<TD>Display negative (reverse) image.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/2 3/2 
 2   2</PRE></TD>
<TD>Display normal intensity.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/2 3/4 
 2   4</PRE></TD>
<TD>Display not underlined.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/2 3/5 
 2   5</PRE></TD>
<TD>Display not blinking.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>3/2 3/7 
 2   7</PRE></TD>
<TD>Display positive image.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.9.2">4.9.2 Select Character Attributes (DECSCA)</H3>
<P>You can select all characters to be erasable or not erasable by
using the following format. (See the "<A HREF="#S4.12">Erasing</A>" section in this
chapter.)</P>
<P CLASS="note">NOTE: This sequence is supported only in VT200 mode.</P>
<PRE>   9/11     2/2  7/1
   CSI  Ps   "    q</PRE>
<P>Ps is one of the following values.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Ps</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>0</TD>
<TD>All attributes off. (Does not apply to SGR.)</TD>
</TR>
<TR VALIGN="TOP">
<TD>1</TD>
<TD>Designate character as not erasable by DECSEL/DECSED. (Attribute on.)</TD>
</TR>
<TR VALIGN="TOP">
<TD>2</TD>
<TD>Designate character as erasable by DECSEL/DECSED. (Attribute off.)</TD>
</TR>
</TBODY>
</TABLE>
<P CLASS="note">NOTE: A parameter value of 0 implies the default, which is
attributes off (erasable by DECSEL/DECSED). A parameter value of 2
is an explicit request for this attribute to be off (so the character is erasable by
DECSEL/DECSED).</P>
<H2 ID="S4.10">4.10 Line Attributes</H2>
<P>Lines attributes are display features that affect a complete
display line. The cursor selects the line affected by the
attribute. The cursor stays in the same character position when
the attribute changes, unless the attribute would move the cursor
past the right margin. In that case, the cursor stops at the right
margin. When you move lines on the screen by scrolling, the
attribute moves with the line. Select line attributes by using the
following sequences.</P>
<P CLASS="note">NOTE: If you erase an entire line while using the erase in
display (ED) sequence, the line attribute changes to single-height
and single-width.</P>
<H3 ID="S4.10.1">4.10.1 Double Height Line (DECDHL)</H3>
<P>These sequences make the line with the cursor the top or bottom
half of a double-height, double-width line. You must use these
sequences in pairs on adjacent lines. The same character must be
used on both lines to form a full character. If the line was
previously single-width, single-height, all characters to the
right of center are lost.</P>
<TABLE>
<TBODY>
<TR>
<TH ALIGN="LEFT">Top Half</TH>
<TH ALIGN="LEFT">Bottom Half</TH>
</TR>
<TR>
<TD><PRE>1/11 2/3 3/3 
ESC   #   3</PRE></TD>
<TD><PRE>1/11 2/3 3/4 
ESC   #   4</PRE></TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.10.2">4.10.2 Single-Width Line (DECSWL)</H3>
<P>The DECSWL sequence makes the line with the cursor single-width,
single-height. This is the line attribute for all new lines on the
screen.</P>
<PRE>1/11 2/3 3/5
ESC   #   5</PRE>
<H3 ID="S4.10.3">4.10.3 Double-Width Line (DECDWL)</H3>
<P>The DECDWL sequence makes the line with the cursor double-width,
single-height. If the line was previously single-width,
single-height, all characters to the right of center screen are
lost.</P>
<PRE>1/11 2/3 3/6
ESC   #   6</PRE>
<H2 ID="S4.11">4.11 Editing</H2>
<P>You use editing sequences to insert and delete characters and
lines of characters at the cursor position. The cursor position
does not change when inserting or deleting lines.</P>
<P>You can delete characters or insert and delete lines as follows.</P>
<P CLASS="note">NOTE: Pn is a variable, ASCII-coded, numeric parameter. If you
select no parameter or a parameter value of 0, the terminal
assumes a parameter value of 1.</P>
<TABLE>
<COL WIDTH="20%">
<COL SPAN="2" WIDTH="40%">
<THEAD>
<TR>
<TH ALIGN="LEFT">Name</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Insert Line (IL)</TD>
<TD><PRE>9/11    4/12 
CSI  Pn  L</PRE></TD>
<TD>Inserts Pn lines at the cursor. If fewer than Pn lines remain from the current line to the end
of the scrolling region, the number of lines inserted is the lesser number. Lines within the
scrolling region at and below the cursor move down. Lines moved past the bottom margin are
lost. The cursor is reset to the first column. This sequence is ignored when the cursor is outside the
scrolling region.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Delete Line (DL)</TD>
<TD><PRE>9/11    4/13 
CSI  Pn  M</PRE></TD>
<TD>Deletes Pn lines starting at the line with the cursor. If fewer than Pn lines remain from the current
line to the end of the scrolling region, the number of lines deleted is the lesser number. As
lines are deleted, lines within the scrolling region and below the cursor move up, and blank lines
are added at the bottom of the scrolling region. The cursor is reset to the first column. This
sequence is ignored when the cursor is outside the scrolling region.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Insert Characters (ICH)<BR>(VT200 mode only)</TD>
<TD><PRE>9/11    4/0 
CSI  Pn  @</PRE></TD>
<TD>Insert Pn blank characters at the cursor position, with the character attributes set to normal. The cursor
does not move and remains at the beginning of the inserted blank characters. A parameter of 0 or 1 inserts
one blank character. Data on the line is shifted forward as in character insertion.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Delete Character (DCH)</TD>
<TD><PRE>9/11    5/0 
CSI  Pn  P</PRE></TD>
<TD>Deletes Pn characters starting with the character at the cursor position. When a character is deleted,
all characters to the right of the cursor move to the left. This creates a space character at the right
margin for each character deleted. Character attributes move with the characters. The spaces created at the end
of the line have all their character attributes off.</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.12">4.12 Erasing</H2>
<P>Erasing removes characters from the screen without affecting other
characters on the screen. Erased characters are lost. The cursor
position does not change when erasing characters or lines. Erasing
a character also erases any character attribute of the character.</P>
<P>You can erase characters as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Name</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Erase Character (ECH)<BR>(VT200 mode only)</TD>
<TD><PRE>9/11     5/8 
CSI  Pn   X</PRE></TD>
<TD>Erases characters at the cursor position and the next Pn-1 characters. A parameter
of 0 or 1 erases a single character. Character attributes are set to normal. No reformatting
of data on the line occurs. The cursor remains in the same position.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="4">Erase in Line (EL)</TD>
<TD><PRE>9/11 4/11
CSI   K</PRE></TD>
<TD>Erases from the cursor to the end of the line, including the cursor position. Line attribute
is not affected.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/0  4/11 
CSI   0    K</PRE></TD>
<TD>Same as above.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/1  4/11 
CSI   1    K</PRE></TD>
<TD>Erases from the beginning of the line to the cursor, including the cursor position. Line attribute
is not affected.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/2  4/11 
CSI   2    K</PRE></TD>
<TD>Erases the complete line.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="4">Erase in Display (ED)</TD>
<TD><PRE>9/11 4/10 
CSI   J</PRE></TD>
<TD>Erases from the cursor to the end of the screen, including the cursor position. Line attribute becomes
single-height, single-width for all completely erased lines.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/0  4/10 
CSI   0    J</PRE></TD>
<TD>Same as above.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/1  4/10 
CSI   1    J</PRE></TD>
<TD>Erases from the beginning of the screen to the cursor, including the cursor position. Line attribute becomes
single-height, single-width for all completely erased lines.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/2  4/10
CSI   2    J</PRE></TD>
<TD>Erases the complete display. All lines are erased and changed to single-width. The cursor does not move.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="4">Selective Erase In Line (DECSEL)<BR>(VT200 move only)</TD>
<TD><PRE>9/11 3/15 4/11 
CSI   ?    K</PRE></TD>
<TD>Erases all erasable characters (DECSCA) from the cursor to the end of the line. Does not affect video line
attributes or video character attributes (SGR).</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/0 4/11 
CSI   ?    0   K</PRE></TD>
<TD>Same as above.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/1 4/11 
CSI   ?    1   K</PRE></TD>
<TD>Erases all erasable characters (DECSCA) from the beginning of the line to and including the cursor position.
Does not affect video line attributes or video character attributes.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/2 4/11 
CSI   ?    2   K</PRE></TD>
<TD>Erases all erasable characters (DECSCA) on the line. Does not affect video line attributes or video character attributes.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="4">Selective Erase In Display (DECSED)<BR>(VT200 mode only)</TD>
<TD><PRE>9/11 3/15 4/10 
CSI   ?    J</PRE></TD>
<TD>Erases all erasable characters (DECSCA) from and including the cursor to the end of the screen. Does
not affect video line attributes or video character attributes (SGR).</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/0 4/10 
CSI   ?    0   J</PRE></TD>
<TD>Same as above.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/1 4/10 
CSI   ?    1   J</PRE></TD>
<TD>Erases all erasable characters (DECSCA) from the beginning of the screen to and including the cursor.
Does not affect video line attributes or video character attributes (SGR).</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/2 4/10 
CSI   ?    2   J</PRE></TD>
<TD>Erases all erasable characters (DECSCA) in the entire display. Does not affect video character attributes or video line attributes (SGR).</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.13">4.13 Scrolling Margins (Top and Bottom)</H2>
<P>The scrolling region is the area of the screen that can receive
new characters by scrolling old characters off the screen. The
area is defined by the top and bottom screen margins. The smallest
scrolling region allowed is two lines; therefore the number of
the top margin must be at least one less than the number of the
bottom margin.</P>
<P>You can select the top and bottom margins of the scrolling region as follows.</P>
<H3 ID="S4.13.1">4.13.1 Set Top and Bottom Margins (DECSTBM)</H3>
<P>This sequence selects top and bottom margins defining the
scrolling region.</P>
<PRE>   9/11    3/11     7/2
   CSI  Pt  ;   Pb   r</PRE>
<H2 ID="S4.14">4.14 Printing</H2>
<P>You can select all print operations with control sequences. When
characters are printed on the screen, terminal and printer tab
stops are ignored. Print characters are spaced with the space (SP)
character. The terminal transmits a carriage return (CR) and line
feed (LF), a vertical tab (VT), or a form feed (FF) after the last
printable character of a line (not a space character).</P>
<P CLASS="note">NOTE: Spaces with video attributes are printable characters.</P>
<P>Before you select a print operation, you should check printer
status with the print status report (DSR) (see the "<A HREF="#S4.17">Reports</A>"
section in this chapter.)</P>
<P>You can select print operations as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Name</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Action</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD ROWSPAN="2">Auto Print Mode</TD>
<TD><PRE>9/11 3/15 3/5  6/9 
CSI   ?    5    i</PRE></TD>
<TD>Turns on auto print mode. Display lines print when you move the cursor off the line with a line feed,
form feed, vertical tab, or auto wrap. The printed line ends with a carriage return and the character that
moved the cursor off the previous line (LF, FF, or VT). Auto wrap lines end with a linefeed.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/15 3/4  6/9 
CSI   ?    4    i</PRE></TD>
<TD>Turns off auto print mode.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="2">Printer Controller</TD>
<TD><PRE>9/11 3/5  6/9 
CSI   5    i</PRE></TD>
<TD><P>Turns on printer controller mode. The terminal sends received characters to the printer without
displaying them on the screen. All characters and character sequences except NUL, XON, XOFF, CSI 5 i,
and CSI 4 i are sent to the printer. The terminal does not insert or delete spaces, provide line delimiters,
or select the correct printer character set. Printer controller mode has a higher priority than auto print mode.
You can select printer controller mode during auto print mode.</P>
<P>In printer controller mode, keyboard activity continues to be directed to the host.</P></TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/4  6/9 
CSI   4    i</PRE></TD>
<TD>Turns off printer controller mode.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Print Cursor Line</TD>
<TD><PRE>9/11 3/15 3/1  6/9 
CSI   ?    1    i</PRE></TD>
<TD>Prints the display line containing the cursor. The cursor position does not change. The print-cursor-line sequence is
complete when the line prints.</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="2">Print Screen</TD>
<TD><PRE>9/11 6/9 
CSI   i</PRE></TD>
<TD>Prints the screen display (full screen or scrolling region, depending on the print extent DECPEX
selection). Printer form feed mode (DECPFF) selects either a form feed (FF) or nothing as the print terminator.
The print screen sequence is complete when the screen prints.</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>9/11 3/0  6/9 
CSI   0    i</PRE></TD>
<TD>Same as above.</TD>
</TR>
</TBODY>
</TABLE>
<H2 ID="S4.15">4.15 User Defined Keys (DECUDK)</H2>
<P>Fifteen of the terminal's top-row function keys are programmable:
<SPAN CLASS="keyname">F6</SPAN> through <SPAN CLASS="keyname">F14</SPAN>, <SPAN CLASS="keyname">Do</SPAN>, <SPAN CLASS="keyname">Help</SPAN>, and <SPAN CLASS="keyname">F17</SPAN> through <SPAN CLASS="keyname">F20</SPAN>. (<SPAN CLASS="keyname">Hold Screen</SPAN>, <SPAN CLASS="keyname">Print
Screen</SPAN>, <SPAN CLASS="keyname">Set-Up</SPAN>, <SPAN CLASS="keyname">Data/Talk</SPAN> and <SPAN CLASS="keyname">Break</SPAN> have dedicated local functions
and are not programmable). When the terminal is in VT200 mode, you
can down-line-load one or more key sequences for the programmable
function keys by using DECUDK device control strings. (The
programmable function keys are inoperative in the VT100 and VT52
modes.)</P>
<P>To access the programmed values of the keys, you type
<SPAN CLASS="keyname">Shift</SPAN>-(function key). To access the normal control sequence
values, you press the function key alone.</P>
<P>There are 256 bytes available to the 15 programmable function
keys. Space is supplied on a first-come/first-serve basis. Once
the 256 bytes are used, you cannot redefine any more keys unless
you clear space. There are three ways you can clear space.</P>
<OL>
<LI><P>Redefine a key or keys by using a DECUDK.</P></LI>
<LI><P>Clear a key or keys by using a DECUDK.</P></LI>
<LI><P>Clear the definition set with a terminal power-up or
recall operation.</P></LI>
</OL>
<P CLASS="note">NOTE: All keys definitions are stored in volatile RAM. UDK key definitions
are lost when terminal power is lost.</P>
<H3 ID="S4.15.1">4.15.1 DECUDK Device Control String Format</H3>
<P CLASS="note">NOTE: See <A HREF="chapter2.html">Chapter 2</A> for general information about device
control strings.</P>
<P>The device control string format for down-line-loading UDK
functions is as follows.</P>
<TABLE>
<TBODY>
<TR>
<TD><CODE>DCS</CODE></TD>
<TD><CODE>Pc;Pl</CODE></TD>
<TD><CODE>|</CODE></TD>
<TD><CODE>Ky1/st1;ky2/st2;...kyn/stn</CODE></TD>
<TD><CODE>ST</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Control String Introducer</TD>
<TD>Clear and Lock Parameters</TD>
<TD>Final Character</TD>
<TD>Key Definition String</TD>
<TD>String Terminator</TD>
</TR>
</TBODY>
</TABLE>
<P>Each string component is described below.</P>
<P CLASS="note">NOTE: This sequence is supported only in VT200 mode.</P>
<P>The <STRONG>device control string introducer</STRONG> is DCS (9/0). This character
introduces the control string. DCS is an 8-bit character (9/0)
that you can also express as ESC P (1/11 5/0) when coding for a
7-bit environment.</P>
<P>The <STRONG>clear parameter</STRONG> (Pc) determines which keys are cleared and
when. A value of 0 (clear all) clears all keys, then loads each
specific key as it is met in the DRCS. A value of 1 (load new
values, clear old only when redefined) clears each key to be
reloaded just before loading it; a 1 does not clear keys that are
not being redefined. By using a value of 1 for Pc, you can
redefine some keys without reloading them all.</P>
<P CLASS="note">NOTE: There are only 256 bytes available. A
key definition cannot contain more than 256 bytes or the number of
bytes available when that key is loaded, whichever is less.</P>
<P>Note that if you set Pc to 1 (load new, but do not clear old), a
key load may fail because no room is available &#8211; even though the
final total for all keys would have been 256 bytes or less. The
reason for this is as follows.</P>
<P>With Pc set to 1, keys are cleared and loaded sequentially.
Sequential loading may result in intermediate storage requirements
higher than 256 bytes, even though the final requirement would be
256 bytes or less. For example, suppose <SPAN CLASS="keyname">F6</SPAN> contained 120 bytes, <SPAN CLASS="keyname">F7</SPAN>
contained 110 bytes, and <SPAN CLASS="keyname">F8</SPAN> contained 20 bytes. Loading <SPAN CLASS="keyname">F8</SPAN> with 40
bytes, <SPAN CLASS="keyname">F6</SPAN> with 1 byte and <SPAN CLASS="keyname">F7</SPAN> with 1 byte works if all keys are
cleared first, but not if the keys are cleared as they are
sequentially redefined. When you try to load <SPAN CLASS="keyname">F8</SPAN> with 40 bytes, the
load fails because only 26 bytes are free at that time (256 - 120
- 110 = 26).</P>
<P>The following is a summary of Pc values and meanings.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Pc</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>None</TD>
<TD>Clear all keys before loading new values.</TD>
</TR>
<TR>
<TD>0</TD>
<TD>Clear all keys before loading new values.</TD>
</TR>
<TR>
<TD>1</TD>
<TD>Load new key values, clear old only where defined.</TD>
</TR>
</TBODY>
</TABLE>
<P>The <STRONG>lock parameter</STRONG> (Pl) determines whether the key definitions are
locked or not locked after you load them. Pl follows the Pc values
and is separated by a semicolon character (<CODE>;</CODE>, 3/11) as a
delimiter. If you set the Pl value to 0 (lock), the keys are locked
at the completion of loading. At this point, the terminal operator
must unlock the keys for redefinition using set-up. If you set
the Pl value to 1 (do not lock), the keys are available for
further definition with another DECUDK string. The default for the
lock parameter is lock.</P>
<P CLASS="note">NOTE: A Pl value of 1 does not unlock the keys. It simply does not lock them.</P>
<P>The following is a summary of Pl values and meanings.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Pl</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>None</TD>
<TD>Lock the keys. (Cannot be redefined.)</TD>
</TR>
<TR>
<TD>0</TD>
<TD>Lock the keys. (Cannot be redefined.)</TD>
</TR>
<TR>
<TD>1</TD>
<TD>Do not lock the keys. (Can be redefined.)</TD>
</TR>
</TBODY>
</TABLE>
<P>The <STRONG>final character</STRONG>, a vertical bar (7/12), designates this
control string as a DECUDK.</P>
<P>The <STRONG>key definition strings</STRONG> (Kyn/Stn) are included in the data
following the final character and before the string terminator. Each key
definition string consists of a key selector number (Kyn) and a
string parameter (Stn) separated by a slash (<CODE>/</CODE>, 2/15).</P>
<P>The key selector numbers (Kyn) specify the particular key to be
redefined, and the string parameters (Stn) are the encoded
contents of the keys. The string parameters (Stn) consist of hex
pairs in the range of 3/0 through 3/9 (0 through 9), 4/1 through
4/6 (A through F), and 6/1 through 6/6 (a through f). When you
combine these hex values, they represent an 8-bit quantity.</P>
<P>This method lets you use any of the 256 character codes in the key
sequence. You can use key definition strings in any order. You can
also specify multiple definitions using a semicolon (<CODE>;</CODE> 3/11)
as a delimiter.</P>
<P>Here is a list of definable keys and their identifying values.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Key</TH>
<TH ALIGN="LEFT">Value</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD>F6</TD>
<TD>17</TD>
</TR>
<TR>
<TD>F7</TD>
<TD>18</TD>
</TR>
<TR>
<TD>F8</TD>
<TD>19</TD>
</TR>
<TR>
<TD>F9</TD>
<TD>20</TD>
</TR>
<TR>
<TD>F10</TD>
<TD>21</TD>
</TR>
<TR>
<TD COLSPAN="2"></TD>
</TR>
<TR>
<TD>F11</TD>
<TD>23</TD>
</TR>
<TR>
<TD>F12</TD>
<TD>24</TD>
</TR>
<TR>
<TD>F13</TD>
<TD>25</TD>
</TR>
<TR>
<TD>F14</TD>
<TD>26</TD>
</TR>
<TR>
<TD COLSPAN="2"></TD>
</TR>
<TR>
<TD>Help</TD>
<TD>28</TD>
</TR>
<TR>
<TD>Do</TD>
<TD>29</TD>
</TR>
<TR>
<TD COLSPAN="2"></TD>
</TR>
<TR>
<TD>F17</TD>
<TD>31</TD>
</TR>
<TR>
<TD>F18</TD>
<TD>32</TD>
</TR>
<TR>
<TD>F19</TD>
<TD>33</TD>
</TR>
<TR>
<TD>F20</TD>
<TD>34</TD>
</TR>
</TBODY>
</TABLE>
<P>The <STRONG>string terminator</STRONG> is <CODE>ST</CODE> (9/12). This is an 8-bit control
character that you can also express as <CODE>ESC \</CODE> (1/11, 5/12) when
coding for a 7-bit environment.</P>
<P CLASS="note">NOTE: To access the programmed values of keys,
you type <SPAN CLASS="keyname">Shift</SPAN>-(function key). To access
the normal control sequences, you type the function key alone.</P>
<H3 ID="S4.15.2">4.15.2 Things to Keep in Mind When Loading Keys</H3>
<P>Here are some general guidelines you should keep in mind when
loading the keys.</P>
<UL>
<LI><P>Software should use the UDK function to clear key definition space. You can do this by clearing keys
without locking them. After the keys are cleared, you can use the UDK function to redefine the keys and lock them.</P></LI>
<LI><P>Generally, you should not leave keys unlocked. This could cause a breach of security for the terminal user and the
computer system.</P></LI>
<LI><P>The host must keep track of space available for definitions.</P></LI>
<LI><P>If you redefine a key, the old sequence is lost. This may clear some space if the new sequence is shorter than the
previous definition.</P></LI>
<LI><P>The terminal uses a special lock to arbitrate the programming of keys. You can turn this lock on or off in
set-up. It may also be turned on with a DECUDK from the host. The lock acts globally over all programmable keys.</P></LI>
<LI><P>The default value for each key definition is empty (blank). When you clear the keys, they are empty. All key
definitions are stored in volatile RAM. If the terminal loses power, key definitions are lost. An aborted
function key load (by error or other cause) locks the keys, saves the already successfully loaded fraction, and
sends the rest of the DECUDK sequence to the screen. An invalid DCS hex pair in a key definition string causes an aborted load.</P></LI>
</UL>
<H3 ID="S4.15.3">4.15.3 Examples and Recommendations for Using DECUDK</H3>
<P>To clear keys, send the following sequence.</P>
<PRE>   9/0  3/0  3/11  3/1  7/12  9/12
   DCS   0    ;     1    |     ST</PRE>
<P>To lock keys, send the following sequence.</P>
<PRE>   9/0  3/1  3/11  3/0  7/12  9/12
   DCS   1    ;     0    |     ST</PRE>
<P>Suppose you want to define key <SPAN CLASS="keyname">F20</SPAN> to be "PRINT", and you want to
do this without clearing or locking any other keys. The first part
of your sequence would look like this.</P>
<PRE>   9/0  3/1  3/11  3/1  7/12  3/3  3/4  2/15
   DCS   1    ;     1    |     3    4    /</PRE>
<P>The 34 after the final character (7/12) identifies key <SPAN CLASS="keyname">F20</SPAN>. After
the slash character (2/15), you would include the definition. The
encoding for "PRINT" is as follows.</P>
<PRE>   P = 50 hex
   R = 52 hex
   I = 49 hex
   N = 4E hex
   T = 54 hex</PRE>
<P>So the rest of the sequence you enter after the slash character would look like this.</P>
<PRE>   3/5  3/0  3/5  3/2  3/4  3/9  3/4  4/5  3/5  3/4  9/12
    5    0    5    2    4    9    4    E    5    4    ST</PRE>
<P>The <CODE>ST</CODE> character (9/12) marks the end of the sequence.</P>
<H2 ID="S4.16">4.16 Down-Line-Loadable Character Set</H2>
<P>In a VT200 mode, the terminal lets you create and down-line-load a
character set containing up to 94 characters. This character set
is called a dynamically redefinable character set (DRCS). After
you create characters, you can load them into the terminal DRCS
buffer by using a DECDLD device control string.</P>
<P CLASS="note">NOTE: This character set is not loaded into nonvolatile RAM.
So when the terminal is powered off, characters are lost.</P>
<H3 ID="S4.16.1">4.16.1 Designing a Character Set</H3>
<P><A HREF="figure4-4.html">Figure 4-4</A> compares DRCS cell size and the terminal's normal
character cell size in pixels. Note that the maximum number of
pixels in the DRCS cell is 80 (8 &times; 10). Note
also, that the normal terminal's character cell size is less than
the DRCS cell size. Since the terminal ignores characters defined
beyond the DRCS cell size, you must design your characters to fit
the DRCS cell size.</P>
<P>Each pixel in a character font is represented by a bit with a
binary value of 1 (on) or 0 (off). One (1) specifies foreground
(pixel on) and zero (0) specifies background (pixel off).</P>
<P>For example, suppose you want to design character A. To do this,
you follow a four-step process.</P>
<OL>
<LI><P>First designate which pixels are to be on and which pixels will be
off. Your design may look like <A HREF="figure4-5.html">Figure 4-5</A>.</P></LI>
<LI><P>After you establish what your DRCS character A will
look like, divide the pixels of the DRCS character cell
into columns of six bits each using the format shown in <A HREF="figure4-6.html">Figure
4-6</A>. The column numbers here designate the order in which the
columns are sent to the terminal.</P>
<P>Each column is now represented as a vertical 1 &times; 6 pixel
matrix called a <EM>sixel</EM>. The least significant bit is at
the top, and the most significant bit is at the bottom.
Because the character height (10 pixels) is not a
multiple of 6, the columns on the bottom of the character
cell have only 4 bits each. (The two highest order bits, 5 and
6, are ignored.)</P></LI>
<LI><P>After you divide your DRCS character into six-pixel
columns (sixels), convert the binary values of each column to
its equivalent character. Because column codes are restricted to
characters with the range of <CODE>?</CODE> (octal 077) to <CODE>~</CODE> (octal 176), you
must add an offset of octal 077 to each column octal value. Thus,
binary value 000000 is converted to octal 077 (octal 0 + octal
77); binary 110101 is converted to octal 164 (octal 65 + octal
077); and binary 111111 is converted to octal 176 (octal 077 +
077).</P></LI>
<LI><P>After you convert the binary column codes to octal values
(using the offset), convert the octal value for each
column to its equivalent character using the ASCII
table in <A HREF="chapter2.html">Chapter 2</A>. <A HREF="figure4-7.html">Figure 4-7</A> provides this conversion
procedure for our example of a DRCS character A.</P></LI>
</OL>
<P>Use this procedure to design each DRCS characters you want. You can
then down-line-load your DRCS characters with the DECDLD device
control string described in the next section. The DRCS characters
consist of a string or strings of characters.</P>
<H3 ID="S4.16.2">4.16.2 Down-Line-Loading DRCS Characters</H3>
<P>You can down-line-load your DRCS character set with the following
DECDLD device control string format.</P>
<P CLASS="note">NOTE: See <A HREF="chapter2.html">Chapter 2</A> for general information about device
control strings.</P>
<PRE>   DCS Pfn;Pcn;Pe;Pcms;Pw;Pt { Dscs Sxbp1;Sxbp2;...;Sxbpn ST</PRE>
<P><STRONG><CODE>DCS</CODE></STRONG> (9/0) is the device control string introducer. It is an 8-bit
control character that you can also express as <CODE>ESC P</CODE> (1/11, 5/0)
when coding for a 7-bit environment.</P>
<P><STRONG><CODE>Pfn;Pcn;Pe;Pcms;Pw;Pt</CODE></STRONG> are parameter characters, separated by
semicolons. <A HREF="table4-9.html">Table 4-9</A> describes these parameters. Valid values for
Pcms, Pw, and Pt are: Pcms = 0, 2, 3 or 4; Pw = 0, 1 or 2; and
Pt = 0 or 1. Invalid combinations are ignored. You can use a
loaded font (character set) in 80 or 132 columns.</P>
<P><CODE>{</CODE> (7/11) is the final character that marks the end of the
parameter characters and specifies a DECDLD function.</P>
<P><STRONG><CODE>Dscs</CODE></STRONG> defines the character set name for the soft font, and is used
in the SCS (select character set) escape sequence.</P>
<P><STRONG><CODE>Sxbp1;Sxbp2;...;Sxbpn</CODE></STRONG> are sixel bit patterns (1 to 94 patterns)
for characters separated by semicolons. Each sixel bit pattern has the form:</P>
<PRE>    S...S/S...S</PRE>
<P>where</P>
<UL>
<LI>the first <CODE>S...S</CODE> represents the upper columns (sixels) of the DRCS character,</LI>
<LI>the slash (2/5) advances the sixel pattern to the lower columns of the DRCS character,</LI>
<LI>and the second <CODE>S...S</CODE> represents the lower columns (sixels) of the DRCS (<A HREF="figure4-6.html">Figure 4-6</A>).</LI>
</UL>
<P><STRONG><CODE>ST</CODE></STRONG> (9/12) is the string terminator. It is an 8-bit control
character that you can also express as <CODE>ESC \</CODE> (1/11, 5/12) when
coding for a 7-bit environment.</P>
<H3 ID="S4.16.3">4.16.3 DECDLD Example</H3>
<P>Suppose you want to load a character set starting with the
character A, designed in the example in <A HREF="#S4.16.1">Paragraph 4.16.1</A>. To do
this, you could use the following device control string.</P>
<PRE>   DCS 1;1;1 { sp @ ogcacgo/B?????B;(next character);.....ST</PRE>
<P><STRONG><CODE>DCS</CODE></STRONG> introduces the sequence.</P>
<P><STRONG><CODE>1;1;1</CODE></STRONG> specifies loading the DRCS font buffer, selects the starting
character as column 2/row 1 of ASCII chart (<A HREF="chapter2.html">Chapter 2</A>), and
selects to erase only the characters that are loaded (<A HREF="table4-9.html">Table 4-9</A>).
Note that Pcms, Pw, and Pt are not included; they default to 0 values.</P>
<P><CODE>{</CODE> indicates the end of the parameter characters and specifies that
this is a DECDLD control string.</P>
<P><STRONG><CODE>sp @</CODE></STRONG> defines a character set as an unregistered soft set. This
value is the recommended default value for user-defined sets. The
"sp" represents one space. Other DRCS values can be used to define
other specific character sets.</P>
<P><STRONG><CODE>ogcacgo</CODE></STRONG> are the character codes for the upper columns of the
example DRCS character A.</P>
<P><CODE>/</CODE> advances the sixel sequence to the lower columns of the example
DRCS character A.</P>
<P><STRONG><CODE>B?????B</CODE></STRONG> are the character codes for the lower columns of the
example DRCS character A.</P>
<P><CODE>;</CODE> signals the end of the DRCS character string being loaded and
the beginning of another DRCS character to be loaded.</P>
<P><STRONG><CODE>ST</CODE></STRONG> indicates the end of the device control string.</P>
<P CLASS="note">NOTE: See the "<A HREF="#S4.4">Character Set Selection</A>" section in this chapter
for information on designating and invoking soft character sets.</P>
<H3 ID="S4.16.4">4.16.4 Clearing a Down-Line-Loaded Character Set</H3>
<P>You can clear a character set that you have down-line-loaded by using
the following DECDLD control sequence:</P>
<PRE>   DCS 1;1;2 { sp @ ST</PRE>
<P>Down-line-loaded character sets are also cleared by the following actions.</P>
<UL>
<LI>Performing the power-up self test</LI>
<LI>Using the set-up "Recall" or "Default" fields</LI>
<LI>Using RIS or ESC c sequences</LI>
</UL>
<H2 ID="S4.17">4.17 Reports</H2>
<P>The terminal sends reports in response to host computer requests.
These reports provide identification (type of terminal), cursor
position, and terminal operating status. There are two categories
of reports, device attributes (DA) and device status reports (DSR).</P>
<H3 ID="S4.17.1">4.17.1 Device Attributes (DA)</H3>
<P>There are two DA exchanges (dialogues) between the host computer
and the VT220, primary DA and secondary DA.</P>
<H4 ID="S4.17.1.1">4.17.1.1 Primary DA</H4>
<P>In the primary DA exchange (the first exchange), the host asks for the terminal's service class code and
the basic attributes. The terminal's response depends on the value
of the "Terminal ID" field selected in set-up.</P>
<P>A typical primary DA exchange is as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Communication</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Host to VT220</TD>
<TD><CODE>CSI c</CODE> or <CODE>CSI 0 c</CODE></TD>
<TD>"What is your service class code and what are your attributes?"</TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to host</TD>
<TD><PRE>CSI ? 62; 1; 2; 6; 7; 8; 9 c </PRE></TD>
<TD>"I am a service class 2 terminal (62) with 132 columns (1), printer port (2), selective erase (6), DRCS (7), UDK (8), and I support
7-bit national replacement character sets (9)."</TD>
</TR>
<TR>
<TD COLSPAN="3"><P CLASS="note">NOTE: If the terminal is in VT100 mode and you select an ID other than VT220 ID, then
the following primary exchanges apply.</P></TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to host<BR>(VT100 ID selected in set-up)</TD>
<TD><PRE>ESC [ ? 1; 2 c</PRE></TD>
<TD>"I am a VT100 terminal with AVO."</TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to host<BR>(VT101 ID selected in set-up)</TD>
<TD><PRE>ESC [ ? 1; 0 c</PRE></TD>
<TD>"I am a VT101 terminal."</TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to host<BR>(VT102 ID selected in set-up)</TD>
<TD><PRE>ESC [ ? 6 c</PRE></TD>
<TD>"I am a VT102 terminal."</TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="S4.17.1.2">4.17.1.2 Secondary DA</H4>
<P>In the secondary DA exchange (the second exchange), the host asks for the
terminal's identification code, firmware version level, and an
account of the hardware options installed.</P>
<P>A typical secondary DA is as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Communication</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Host to VT220 (Secondary DA request)</TD>
<TD><CODE>CSI &gt; c</CODE> or <CODE>CSI &gt; 0 c</CODE></TD>
<TD>"What type of terminal are you, what is your firmware version, and what hardware options do you have installed?"</TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to Host (Secondary DA response)</TD>
<TD><PRE>CSI &gt; 1; Pv; Po c</PRE></TD>
<TD>"I am a VT220 (identification code of 1), my firmware version is _____ (Pv), and I have _____ Po options installed."</TD>
</TR>
</TBODY>
</TABLE>
<P><STRONG>Example</STRONG></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;<CODE>CSI&gt;1;10;0c</CODE> = VT220 version 1.0, no options.</P>
<H3 ID="S4.17.2">4.17.2 Device Status Report (DSR)</H3>
<P>In a DSR exchange, the host computer asks for the general
operating status of the terminal and/or printer. If the terminal
is in print controller mode, the printer receives the DSR
request but cannot answer.</P>
<H4>DSR &#8211; VT220</H4>
<P>A typical DSR exchange is as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Communication</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Host to VT220<BR>(Request for terminal status)</TD>
<TD><CODE>CSI 5 n</CODE></TD>
<TD>"Please report your operating status using a DSR control sequence. Are you in good operating condition or do you have a malfunction?"</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="3">VT220 to host<BR>(DSR Response)</TD>
<TD><CODE>CSI 0 n</CODE></TD>
<TD>"I have no malfunction."</TD>
</TR>
<TR>
<TD>or</TD>
<TD></TD>
</TR>
<TR VALIGN="TOP">
<TD><CODE>CSI 3 n</CODE></TD>
<TD>"I have a malfunction."</TD>
</TR>
<TR VALIGN="TOP">
<TD>Host to VT220<BR>(Request for cursor position)</TD>
<TD><CODE>CSI 6 n</CODE></TD>
<TD>"Please report your cursor position using a CPR (not DSR) control sequence."</TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to host<BR>(CPR response)</TD>
<TD><PRE>CSI Pv; Ph R </PRE></TD>
<TD><P>"My cursor is positioned at _____ (Pv); _____ (Ph)."</P>
<TABLE>
<TBODY>
<TR VALIGN="TOP">
<TD>Pv&nbsp;=</TD>
<TD>vertical position (row)</TD>
</TR>
<TR VALIGN="TOP">
<TD>Ph&nbsp;=</TD>
<TD>horizontal position (column)</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<H4>DSR &#8211; Printer Port</H4>
<P CLASS="note">NOTE: Determine the printer status before entering any print mode or starting any print function.</P>
<P>A typical DSR exchange is as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Communication</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Host to VT220<BR>(Request for printer status)</TD>
<TD><PRE>CSI ? 15 n </PRE></TD>
<TD>"What is the printer status?"</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="3">VT220 to host</TD>
<TD><PRE>CSI ? 13 n </PRE></TD>
<TD>"DTR has not been asserted on the printer port since power up or reset &#8211; in effect, I have no printer."</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>CSI ? 10 n </PRE></TD>
<TD>"DTR is asserted on the printer port. The printer is ready."</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>CSI ? 11 n </PRE></TD>
<TD>"DTR is not currently asserted on the printer port. The printer is not ready."</TD>
</TR>
</TBODY>
</TABLE>
<H4>DSR &#8211; User Defined Keys (VT220 mode only)</H4>
<P>A typical DSR exchange is as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Communication</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Host to VT220<BR>(Request for UDK status)</TD>
<TD><PRE>CSI ? 25 n </PRE></TD>
<TD>"Are user-defined keys locked or unlocked?"</TD>
</TR>
<TR VALIGN="TOP">
<TD ROWSPAN="2">VT220 to host</TD>
<TD><PRE>CSI ? 20 n </PRE></TD>
<TD>"User-defined keys are unlocked."</TD>
</TR>
<TR VALIGN="TOP">
<TD><PRE>CSI ? 21 n </PRE></TD>
<TD>"User-defined keys are locked."</TD>
</TR>
</TBODY>
</TABLE>
<H4>DSR &#8211; Keyboard Language</H4>
<P>A typical DSR exchange is as follows.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Communication</TH>
<TH ALIGN="LEFT">Sequence</TH>
<TH ALIGN="LEFT">Meaning</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Host to VT220<BR>(Request for keyboard language)</TD>
<TD><PRE>CSI ? 26 n </PRE></TD>
<TD>"What is the keyboard language?"</TD>
</TR>
<TR VALIGN="TOP">
<TD>VT220 to host</TD>
<TD><PRE>CSI ? 27; Pn n </PRE></TD>
<TD><P>"My keyboard language is _____ (Pn)."</P>
<P>where:</P>
<TABLE>
<THEAD>
<TR>
<TH>Pn</TH>
<TD></TD>
<TH>Language</TH>
</TR>
</THEAD>
<TFOOT>
<TR>
<TD COLSPAN="3">* Sent by a terminal that for some reason cannot determine its
keyboard language. The VT220 will never send this response.</TD>
</TR>
</TFOOT>
<TBODY>
<TR>
<TD>0</TD>
<TD>=</TD>
<TD>Unknown*</TD>
</TR>
<TR>
<TD>1</TD>
<TD>=</TD>
<TD>North American</TD>
</TR>
<TR>
<TD>2</TD>
<TD>=</TD>
<TD>British</TD>
</TR>
<TR>
<TD>3</TD>
<TD>=</TD>
<TD>Flemish</TD>
</TR>
<TR>
<TD>4</TD>
<TD>=</TD>
<TD>French Canadian</TD>
</TR>
<TR>
<TD>5</TD>
<TD>=</TD>
<TD>Danish</TD>
</TR>
<TR>
<TD>6</TD>
<TD>=</TD>
<TD>Finnish</TD>
</TR>
<TR>
<TD>7</TD>
<TD>=</TD>
<TD>German</TD>
</TR>
<TR>
<TD>8</TD>
<TD>=</TD>
<TD>Dutch</TD>
</TR>
<TR>
<TD>9</TD>
<TD>=</TD>
<TD>Italian</TD>
</TR>
<TR>
<TD>10</TD>
<TD>=</TD>
<TD>Swiss (French)</TD>
</TR>
<TR>
<TD>11</TD>
<TD>=</TD>
<TD>Swiss (German)</TD>
</TR>
<TR>
<TD>12</TD>
<TD>=</TD>
<TD>Swedish</TD>
</TR>
<TR>
<TD>13</TD>
<TD>=</TD>
<TD>Norwegian</TD>
</TR>
<TR>
<TD>14</TD>
<TD>=</TD>
<TD>French/Belgian</TD>
</TR>
<TR>
<TD>15</TD>
<TD>=</TD>
<TD>Spanish</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.17.3">4.17.3 Identification (DECID)</H3>
<P>The DECID sequence causes the terminal to send a primary DA
response sequence. Digital does not recommend using DECID. You should
use the primary DA request for this purpose.</P>
<P>The DECID sequence is as follows.</P>
<PRE>   1/11 5/10
   ESC   Z</PRE>
<H2 ID="S4.18">4.18 Terminal Reset (DECSTR and RIS)</H2>
<P>There are two terminal reset escape sequences. One causes a soft
terminal reset (DECSTR), and the other causes a hard terminal
reset (RIS).</P>
<H3 ID="S4.18.1">4.18.1 Soft Terminal Reset (DECSTR)</H3>
<P>You can invoke DECSTR (soft terminal reset) from the keyboard by
selecting "Reset Terminal" in the Set-Up Directory screen. It can
be invoked directly from the host computer via the DECSTR
sequence, if the terminal is in a VT200 mode. (When the terminal
is in VT100 or VT52 mode, the escape sequence is ignored.) It can
also be invoked indirectly via the DECSCL sequence (ignored in
VT52 mode).</P>
<P>The DECSTR sequence sets the terminal to the power-up default
states listed in <A HREF="table4-10.html">Table 4-10</A>.</P>
<P>The DECSTR escape sequence is as follows.</P>
<PRE>   9/11 2/1 7/0
   CSI   !   p</PRE>
<H3 ID="S4.18.2">4.18.2 Hard Terminal Reset (RIS)</H3>
<P>You can invoke RIS (hard terminal reset or reset to initial
state) from the keyboard by selecting "Recall" in the Set-Up
Directory screen. It can also be invoked from the host computer
with an escape sequence. RIS causes an NVR recall. All set-up
parameters are replaced either by their NVR values, or power-up
default values if NVR values do not exist.</P>
<P>In addition, RIS performs the following actions.</P>
<UL>
<LI><P>Performs a communications line disconnect.</P></LI>
<LI><P>Clears UDKs.</P></LI>
<LI><P>Clears a down-line-loaded character set.</P></LI>
<LI><P>Clears the screen.</P></LI>
<LI><P>Returns the cursor to the upper-left corner of the screen.</P></LI>
<LI><P>Sets the SGR state to normal.</P></LI>
<LI><P>Sets the selective erase attribute write state to "not erasable".</P></LI>
<LI><P>Sets all character sets to the default.</P></LI>
</UL>
<P>The RIS escape sequence is as follows.</P>
<PRE>   1/11 6/3
   ESC   c</PRE>
<P CLASS="note">NOTE: Use this sequence with caution. Parity and baud rate are restored from NVR.</P>
<H2 ID="S4.19">4.19 Tests and Adjustments (DECTST and DECALN)</H2>
<P>The terminal has tests and alignment patterns you can invoke from
the keyboard or from the host computer with control and escape
sequences. Test and alignment procedures are usually performed
only by Digital Manufacturing and Field Service personnel.</P>
<P>This section provides the sequences used to invoke the tests and
the alignment patterns. For detailed information, see the <CITE>VT220 Pocket Service Guide</CITE>.</P>
<H3 ID="S4.19.1">4.19.1 Tests (DECTST)</H3>
<P>The sequence format for invoking terminal tests is as follows.</P>
<PRE>   9/11 3/4  3/11     3/11    3/11     7/9
   CSI   4    ;   Ps   ; ..... ;   Ps   y</PRE>
<P>Each Ps is a parameter indicating a test to perform. After the
first parameter (4), the parameters each select one test from the
following list. You can invoke several tests at one time by
separating the parameters with semicolons. The tests are not
necessarily executed in the order you enter them.</P>
<P CLASS="note">NOTE: DECTST causes a communications line disconnect.</P>
<TABLE>
<THEAD>
<TR>
<TH ALIGN="LEFT">Parameter</TH>
<TH ALIGN="LEFT">Test</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>0</TD>
<TD>Test 1, 2, 3 and 6</TD>
</TR>
<TR VALIGN="TOP">
<TD>1</TD>
<TD>Power-up self test</TD>
</TR>
<TR VALIGN="TOP">
<TD>2</TD>
<TD>EIA port data loopback test</TD>
</TR>
<TR VALIGN="TOP">
<TD>3</TD>
<TD>Printer port loopback test</TD>
</TR>
<TR VALIGN="TOP">
<TD>4</TD>
<TD>Not used</TD>
</TR>
<TR VALIGN="TOP">
<TD>5</TD>
<TD>Not used</TD>
</TR>
<TR VALIGN="TOP">
<TD>6</TD>
<TD>EIA port modem control line loopback test</TD>
</TR>
<TR VALIGN="TOP">
<TD>7</TD>
<TD>20 mA port loopback test</TD>
</TR>
<TR VALIGN="TOP">
<TD>8</TD>
<TD>Not used</TD>
</TR>
<TR VALIGN="TOP">
<TD>9</TD>
<TD>Repeat any selected test continuously until power-off or failure</TD>
</TR>
<TR VALIGN="TOP">
<TD>10 and up</TD>
<TD>Not used</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="S4.19.2">4.19.2 Adjustments (DECALN)</H3>
<P>The terminal has a screen alignment pattern that service personnel
use to adjust the screen. You can display the screen alignment
pattern with the DECALN sequence.</P>
<PRE>   1/11 2/3 3/8
   ESC   #   8</PRE>
<P>This sequence fills the screen with uppercase E's.</P>
<H2 ID="S4.20">4.20 VT52 Mode Escape Sequences</H2>
<P>The VT52 mode allows the VT220 to operate with Digital software
written for the VT52 terminal. In VT52 mode, all C0 control
characters are allowed, although some are ignored. No C1 control
characters or ANSI mode control functions are allowed. The
user-defined keys are disabled. <A HREF="table4-11.html">Table 4-11</A> defines the VT52 mode
escape sequences. <A HREF="table3-3.html">Table 3-3</A> in <A HREF="chapter3.html">Chapter 3</A> defines the VT52
auxiliary keypad codes. The set-up VT100 (ASCII/UK) default
character set applies to VT52 mode as well.</P>
<DIV CLASS="navbar"><HR>
<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="chapter3.html">Chapter 3</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="appendixa.html">Appendix A</A></TD>
</TR>
</TBODY>
</TABLE>
<DIV CLASS="navbot">http://vt100.net/docs/vt220-rm/chapter4.html</DIV></DIV>
</BODY>
</HTML>
